<%@ include file="/common/taglibs.jsp" %>

<head>
    <title><fmt:message key="linkDetail.title" /></title>
    <meta name="menu" content="LinkMenu" />
</head>

<div class="col-sm-3">
    <h2><fmt:message key="linkDetail.heading" /></h2>
</div>
<div class="col-sm-6">
<form:errors path="*" cssClass="alert alert-danger alert-dismissable" />
<form:form commandName="link" method="post" action="linkform" cssClass="well" id="linkForm">
    <form:hidden path="id" />
    <%--text textbox--%>
    <spring:bind path="link.text">
        <div class="form-group${(not empty status.errorMessage) ? ' has-error' : ''}"
    </spring:bind>
    <appfuse:label key="link.text" styleClass="control-label" />
    <form:input path="text" cssClass="form-control" id="text" maxlength="50" />
    <form:errors path="text" cssClass="help-block" />
    <%--href textbox--%>
    </div>
    <spring:bind path="link.href">
        <div class="form-group${not empty status.errorMessage ? ' has-error':''}"
    </spring:bind>
    <appfuse:label key="link.href" styleClass="control-label" />
    <form:input path="href" cssClass="form-control" id="href" maxlength="512" />
    <form:errors path="text" cssClass="help-block" />
    </div>

    <%--buttons--%>
    <div class="form-group">
        <button type="submit" class="btn btn-primary" id="save" name="save">
            <i class="icon-ok icon-white"></i><fmt:message key="button.save" />
        </button>
        <c:if test="${not empty link.id}">
            <button type="submit" class="btn btn-danger" id="delete" name="delete">
                <i class="icon-trash icon-white"></i><fmt:message key="button.delete" />
            </button>
        </c:if>
        <button type="submit" class="btn btn-default" name="cancel" onclick="bCancel=true">
            <i class="icon-remove"></i><fmt:message key="button.cancel" />
        </button>
    </div>
</form:form>
</div>